/*
 * @Description: 维修保养接口
 * @Author: lwx
 * @Date: 2022-11-23 20:02:02
 * @LastEditors: lwx
 * @LastEditTime: 2023-04-12 11:29:45
 */
import request from '@/utils/request'

/* 维修 */
export function deviceMaintain(data) {
    return request({
        contentType: false,
        headers: { 'Content-Type': 'multipart/form-data' },
        url: '/history',
        method: 'POST',
        data: data
    })
}

/* 查询设备维修填写记录是否填写 */
export function searchMaintain(facility_id) {
    return request({
        contentType: false,
        url: '/history/facility',
        method: 'GET',
        params: {
            facility_id
        }
    })
}

/* 获取保养时间 */
export function serviceTime(facility_id) {
    return request({
        url: '/history/facility/0',
        method: 'GET',
        params: {
            facility_id
        }
    })
}

/* 维护记录
history?is_maintain=1                 查询全部维修记录
history?is_maintain=1&machine_no=fx   查询维修记录且机械编号为fx
history?is_maintain=0                 查询全部保养记录
history?is_maintain=0&machine_no=fx   查询保养记录且机械编号为fx 
*/
export function recordList(data) {
    return request({
        url: '/history',
        method: 'GET',
        params: data
    })
}